#include "oled_driver.h"

void oled_task() _task_ OLED_SPI
{
    while (1) {
        if (oled_spi_switch == 0) {
            OLED_Clear();
        }
        if (oled_spi_switch == 1) {
            // 写中文
            OLED_Display_GB2312_string(0, 0, "李大爷");
            // 写英文
            OLED_Display_GB2312_string(0, 2, "are u ok?");
            // 只能写英文
            OLED_Display_string_5x7(0, 4, "i am very ok!!");
            os_wait2(K_TMO, 200); // 5ms * 200 = 1000ms
            OLED_Clear();
            OLED_Display_128x64(gImage_img);
            os_wait2(K_TMO, 200); // 5ms * 200 = 1000ms
            OLED_Clear();
        }
        if (oled_spi_movie1 = 1) {
            OLED_DrawBMP(0, 0, 82, 64, bmp1);
            delay_ms(100);
            OLED_DrawBMP(0, 0, 82, 64, bmp2);
            delay_ms(100);
            OLED_DrawBMP(0, 0, 82, 64, bmp3);
            delay_ms(100);
            OLED_DrawBMP(0, 0, 82, 64, bmp4);
            delay_ms(100);
            OLED_DrawBMP(0, 0, 82, 64, bmp5);
            delay_ms(100);
            OLED_DrawBMP(0, 0, 82, 64, bmp6);
        }
        if (oled_spi_movie2 = 1) {
            OLED_DrawBMP(0, 0, 82, 64, bmp7);
            delay_ms(150);
            OLED_DrawBMP(0, 0, 82, 64, bmp9);
            delay_ms(150);
            OLED_DrawBMP(0, 0, 82, 64, bmp8);
            delay_ms(150);
            OLED_DrawBMP(0, 0, 82, 64, bmp9);
            delay_ms(150);
        }
    }
}
